#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+1000;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL a[2][maxn];
LL sum[2][maxn];
int main(void){
   	cin.tie(0);std::ios::sync_with_stdio(false);
    LL t;cin>>t;
    while(t--){
        LL n;cin>>n;
        for(LL i=1;i<=n+10;i++) a[0][i]=a[1][i]=sum[0][i]=sum[1][i]=0;

        for(LL i=1;i<=n;i++) cin>>a[0][i];
        for(LL i=1;i<=n;i++) cin>>a[1][i];

        for(LL i=n;i>=1;i--){
            sum[0][i]=sum[0][i+1]+a[0][i];
        }
        for(LL i=n;i>=1;i--){
            sum[1][i]=sum[1][i+1]+a[1][i];
        }
        vector<LL>v;
        LL ans1=sum[0][2];
        LL ans2=sum[1][1]-a[1][n];
        v.push_back(ans1);
        v.push_back(ans2);
        if(n==1){
            cout<<"0"<<"\n";
            continue;
        }
        LL res=0;
        for(LL i=2;i<n;i++){
            LL cnt1=sum[0][i+1];
            LL cnt2=sum[1][1]-sum[1][i];
            v.push_back(max(cnt1,cnt2));
        }
        sort(v.begin(),v.end());
//        for(auto i:v){
//            cout<<i<<" ";
//        }cout<<"\n";
        ///debug(res);
        cout<<v[0]<<"\n";
    }
   	return 0;
}
